import emptyUtil from './emptyUtil'

export default {
  // 返回显示报告数值
  findReportValue (reportType, reportValue) {
    let rValue = ''
    if (emptyUtil.stringIsEmpty(reportType) || emptyUtil.isEmpty(reportValue)) {
      return rValue
    }
    if (reportType === 'FeNO') {
      if (reportValue < 5) {
        rValue = '<5ppb'
      } else if (reportValue > 500) {
        rValue = '>500ppb'
      } else {
        rValue = Math.round(reportValue) + 'ppb'
      }
    } else if (reportType === 'CaNO') {
      if (reportValue < 1) {
        rValue = '<1ppb'
      } else if (reportValue > 500) {
        rValue = '>500ppb'
      } else {
        rValue = (Math.round(reportValue * 10) / 10) + 'ppb'
      }
    } else if (reportType === 'FnNO') {
      if (reportValue < 5) {
        rValue = '<5ppb'
      } else if (reportValue > 3500) {
        rValue = '>3500ppb'
      } else {
        rValue = Math.round(reportValue) + 'ppb'
      }
    } else if (reportType === '离线') {
      if (reportValue < 5) {
        rValue = '<5ppb'
      } else if (reportValue > 500) {
        rValue = '>500ppb'
      } else {
        rValue = Math.round(reportValue) + 'ppb'
      }
    } else if (reportType === '潮气') {
      if (reportValue < 5) {
        rValue = '<5ppb'
      } else if (reportValue > 500) {
        rValue = '>500ppb'
      } else {
        rValue = Math.round(reportValue) + 'ppb'
      }
    } else if (reportType === 'FeCO') {
      if (reportValue < 5) {
        rValue = '<5ppb'
      } else if (reportValue > 500) {
        rValue = '>500ppb'
      } else {
        rValue = Math.round(reportValue) + 'ppb'
      }
    }
    return rValue
  }
}
